CREATE OR REPLACE FUNCTION get_value(TEXT) RETURNS TEXT AS $$
DECLARE
	val TEXT = NULL;
BEGIN
    
  CREATE TEMP TABLE IF NOT EXISTS session_variables (
     key   TEXT NOT NULL PRIMARY KEY,
     value TEXT
  );
  
  SELECT into val value 
   FROM session_variables 
  WHERE key = $1;
  
  return val;

 END;
$$ LANGUAGE plpgsql;

